#ifndef __LOADREQUEST_H__
#define __LOADREQUEST_H__

#include "base/DataRequest.h"

/// A request for data
class LoadRequest : public DataRequest { 
  public:
    NEW_DELETE_OPERATORS_H(LoadRequest,DataRequest);
    LoadRequest (VA addr,
                 Processor* p,
                 Entity* source,
                 Entity* dest,
                 int dataSize,
                 int headerSize = 0) :
        DataRequest(addr, p, source, dest, dataSize, headerSize)
    {
        shared = false;
        aborted = false;
        readFromSnapshot = false;
    }
    LoadRequest (const LoadRequest& lr);
    virtual ~LoadRequest () {}
    virtual void resetForRetry ();

    /** When completing a load request, set the shared bit if the line
        is contained within another cache.
    */
    void setShared(const bool newShared) { shared = newShared; }
    bool isShared() const { return shared; }

    /** when snooping a load request, set this bit if the line
        is modified. this request is aborted and the dirty line
        is flushed to memory.
    */
    bool aborted;  

    virtual const char* toString ();
    
  private:
    bool shared;
    bool readFromSnapshot;
};

#endif // __LOADREQUEST_H__
